#ifndef CIF_DATA_LOADER_BY_LINE_H
#define CIF_DATA_LOADER_BY_LINE_H

#include "ACifDataLoader.h"
#include "CifData.h"

class CifDataLoaderByLine : public ACifDataLoader
{
private:

    /** 
     * The read buffer. Contains current line of a CIF-file.
     */
	char readBuffer[CIF_MAX_LINE_LENGTH];

	/** 
     * The current character just read from the file.
     */
	char currentChar;

	/** 
     * The number of the current line.
     */
	int currentLine;

    /** 
     * The number of the current column.
     */
	int currentColumn;

    /** 
     * The length of the current line.
     */
	int currentLineLength;

	/**
     * Reads the line from the CIF-file.
     * @return Error code.
     */
	void ReadLine();

	/**
     * Reads next character of the current line.
     * @return Error code.
     */
	char ReadChar();

	/**
	 * Returns 1 if end of current line is reached.
	 */
	int IsEndOfLine();

public:

	/**
     * The constructor.
     * Initializes all members by-default.
     */
	CifDataLoaderByLine();

	/**
     * The destructor.
     * Frees all used memory.
     */
	~CifDataLoaderByLine();

    /**
     * Loads all data from the input file.
     * @param fileName Full name of the file.
     * @return Loaded data.
     */
	void Parse();
};

#endif